home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Magazine
/
Online
/
HLHandler110
/
extras
/
CleanUpHotList.rexx
next >
Wrap
OS/2 REXX Batch file
|
1996-12-07
|
1KB
|
71 lines
/* $VER: CleanUpHotList.rexx 1.0 © Robert Nienkemper
*
* This script will clean-up an AWeb's hotlist created by the Arexx
* utility 'AddToHotlist.aweb' from Robert Nienkemper
*
*/
Signal ON Syntax
Temp = "T:HLH.temp"
Parse Arg file
/* open files */
If Exists(file) Then
Do
If ~Open('infile',file,R) Then Exit 20
If ~Open('outfile',Temp,W) Then
Do
Call Close('infile')
Exit 20
End
/* read & write the first line */
ol=ReadLN('infile')
Call WriteLN('outfile',ol)
/* skip the index group created by AddToHotlist.aweb */
ol=ReadLN('infile')
If((Index(ol,"<B>Index")>0) & ~Eof('infile')) Then
Do While ~Eof('infile')
ol=ReadLN('infile')
If(Index(ol,"@ENDGROUP")) Then Leave
End
Else Call Seek('infile',-(Length(ol)+1))
/* clean-up the rest of file */
ng="@GROUP "
Do Forever
ol=ReadLN('infile')
If Eof('infile') Then Leave
If(Index(ol,"@GROUP") & (Index(ol,"<B>")>0)) Then
nl=ng||Substr(ol,Pos('>',ol)+1,Pos('</B>',ol)-(Pos('>',ol)+1))
Else If(Index(ol,"#index")) Then
Do
ol=ReadLN('infile')
nl=ReadLN('infile')
End
Else nl=ol
Call WriteLN('outfile',nl)
End
Call Close('infile')
Call Close('outfile')
Address Command Copy '"'Temp'"' '"'file'"'
End
If Exists(Temp) Then
Address Command Delete '"'Temp'"' ">NIL:"
Exit
/* EOF */